package ru.infosystem.client.listener;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import ru.infosystem.client.BDConnection;

/**
 *
 * @author akoshi
 */

public class ClientFrameWindowListener implements WindowListener {
    
    BDConnection connection;
    
    public ClientFrameWindowListener(BDConnection connection) {
        this.connection = connection;
        
    }

    @Override
    public void windowOpened(WindowEvent we) { }

    @Override
    public void windowClosing(WindowEvent we) {
        connection.close();
    }

    @Override
    public void windowClosed(WindowEvent we) { }

    @Override
    public void windowIconified(WindowEvent we) { }

    @Override
    public void windowDeiconified(WindowEvent we) { }

    @Override
    public void windowActivated(WindowEvent we) { }

    @Override
    public void windowDeactivated(WindowEvent we) { }    
}
